﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using EZCRS.HCMS.Data;
using EZCRS.HCMS.Entity;


namespace EZCRS.HCMS.SqlClient
{
    public class sql_AdmLog
    {
        #region 日志列表
        public DataSet Log_List()
        {
            return ExecSql.GetDataSet("select * from hfg_syslogs");
        }
        #endregion

        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet Log_List(int PageSize, int PageIndex, string StrWhere)
        {
            return ExecSql.AddParamFrKeyField("hfg_syslogs", "*", "logtime desc", "logid", PageSize, PageIndex, StrWhere);
        }

        ///<summary>
        ///分页获取数据总数
        ///</summary>
        public int Getrecordcount(string strWhere)
        {
            string sqlstring = "SELECT COUNT(*) as recordcount FROM hfg_syslogs";
            if (strWhere != null && strWhere != "")
            {
                sqlstring += " WHERE " + strWhere;
            }
            DataSet ds = ExecSql.GetDataSet(sqlstring);
            return Convert.ToInt32(ds.Tables[0].Rows[0]["recordcount"]);
        }
    }
}
